<?

class Config extends Controller {

	private $config_values;

	function __construct() {

		parent::Controller();
		$this->load->library('Spyc');
		$path = "cfg/config.yaml";
		$this->config_values = $this->spyc->YAMLLoad($path);
	}

	function value($type = null) {
		
		$this->config_values['wiki_create_script'] = $_SERVER['SCRIPT_NAME'].'/wiki/create/';
		$this->config_values['wiki_ajax_textbox_script'] = $_SERVER['SCRIPT_NAME'].'/wiki/create/';
		if (is_null($type)) {
			$this->load->view('json', array('json' => json_encode($this->config_values)));
		} else {
			if (array_key_exists($type, $this->config_values)) {
				$this->load->view('json', array('json' => json_encode($this->config_values[$type])));
			}
		}
	}

	function test() {


		echo $_SERVER['SCRIPT_NAME'];

	}
}

?>
